<?php

namespace App\Shop\Controllers;

use App\Shop\Logic\MerchantLogic;
use Dingo\Api\Http\Request;

class MerchantController extends BaseController
{
    /**
     * @notes 获取商户信息
     * @param Request $request
     * @return \Dingo\Api\Http\Response
     * @author Evil丿
     * @date 2024/08/07 15:11
     */
    public function getMerchantSaleById(Request $request)
    {
        $params = $request -> all();

        $data = MerchantLogic::getSaleById($params['user_id']);

        if(!$data) {
            return $this->error('用户不存在');
        }

        return $this->success($data);
    }

    public function getUserDepositNow(Request $request)
    {
        $params = $request -> all();

        $data = MerchantLogic::getUserDepositNow($params['user_id']);

        if(!$data) {
            return $this->error('用户不存在');
        }

        return $this->success($data);
    }
}
